<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-15 16:56:45
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-15 17:11:22
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!--  斐波那契数列-->
    <script>
        function fib(n){
            
            if(n===1||n===2){
                return 1;
            }
            return fib(n-1)+fib(n-2);
        }
        
        console.log(fib(7));//第七个斐波那契的值
    </script>
</body>
</html>